# coding: utf8

from math import sin
import turtle
from turtle import *

length = 100
angle = 360 / 8

t1 = turtle.Turtle()
color('red')
speed(0)

for i in range(8):

	if i % 2==0:
		color("red")
	else:
		color("blue")

	begin_fill()
	forward(length)
	left(angle)
	forward(length)
	left(180 - angle)
	forward(length)
	left(angle)
	forward(length)
	left(180 - angle)
	end_fill()

	left(angle)


forward(length)
left(180 -(180- angle) /2)

alpha = angle * 3.1415926536 / 180 # 角度转弧度
step = 2 * length * sin(alpha/2)

color('yellow')

begin_fill()

for i in range(8):
	forward(step)
	left(angle)

end_fill()

turtle.done()